package com.itheima.converter;

import com.itheima.dto.OrderDTO;
import com.itheima.dto.OrderSettingDTO;
import com.itheima.pojo.Order;
import com.itheima.pojo.OrderSetting;
import com.itheima.vo.OrderSettingVO;

public class OrderConverter {
    public static Order  orderDTOToOrder(OrderDTO orderDTO){
        Order result = new Order();
        result.setId(orderDTO.getId());
        result.setOrderStatus(orderDTO.getOrderStatus());
        return  result;
    }
    public static OrderSetting orderSettingToOrderSettingDTO(OrderSettingDTO orderSettingDTO){
        OrderSetting result = new OrderSetting();
        result.setOrderDate(orderSettingDTO.getOrderDate());
        result.setNumber(orderSettingDTO.getNumber());
        return result;
    }
    public static OrderSettingVO orderSettingToOrderSettingVO(OrderSetting orderSetting){
        OrderSettingVO result = new OrderSettingVO();
        result.setNumber(orderSetting.getNumber());
        result.setReservations(orderSetting.getReservations());
        return result;
    }
}
